# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=golang-github-ruudk-golang-pdf417
pkgver=0.0.20181030
_commit=1af4ab5afa58c956c53ed723dee66437498b9415
pkgrel=2
pkgdesc='Port of pdf417-php by ihabunek in Golang'
arch=('any')
url="https://github.com/ruudk/golang-pdf417"
license=('MIT')
depends=('go' 'golang-github-boombuler-barcode' 'golang-github-jung-kurt-gofpdf'
         'golang-github-stretchr-testify')
source=("$pkgname-$_commit.tar.gz::https://github.com/ruudk/golang-pdf417/archive/$_commit.tar.gz")
sha512sums=('9c53ca2aff109e8f3cfd4f0ae04dd57e3323c6821012819c9112192b47d9bfded0db05558366c1b81aa41676a9df367924fd962f750023435c6fdf289bbede20')

check() {
  export GOPATH="$srcdir/build:/usr/share/gocode"
  mkdir -p "$srcdir"/build/src/github.com/ruudk
  cp -a "$srcdir"/golang-pdf417-$_commit "$srcdir"/build/src/github.com/ruudk/golang-pdf417
  cd "$srcdir"/build/src/github.com/ruudk/golang-pdf417
  go test -v $(go list ./...)
}

package() {
  mkdir -p "$pkgdir"/usr/share/gocode/src/github.com/ruudk
  cp -a "$srcdir"/golang-pdf417-$_commit "$pkgdir"/usr/share/gocode/src/github.com/ruudk/golang-pdf417

  install -Dm644 golang-pdf417-$_commit/LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
